package com.thinvent.recommend.service.impl;

import com.thinvent.recommend.manager.dto.RecommendedDocDTO;
import com.thinvent.recommend.manager.manager.RecommendationManager;
import com.thinvent.recommend.service.RecommendationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * RecommendationService 实现，将 Manager 封装成 Service 层
 */
@Service
public class RecommendationServiceImpl implements RecommendationService {

    private final RecommendationManager recommendationManager;

    @Autowired
    public RecommendationServiceImpl(RecommendationManager recommendationManager) {
        this.recommendationManager = recommendationManager;
    }

    @Override
    public List<RecommendedDocDTO> recommendByUser(String userId) {
        return recommendationManager.getUserRecommendations(userId);
    }

    @Override
    public List<RecommendedDocDTO> recommendByPosition(String userId) {
        // 基于岗位关键词的推荐
        return recommendationManager.recommendByUserPosition(userId);
    }

    @Override
    public List<RecommendedDocDTO> recommendByDeptHistory(String userId) {
        return recommendationManager.recommendByDeptHistory(userId);
    }
}
